package cn.lili.modules.promotion.mapper;

import cn.lili.modules.promotion.entity.dos.KanjiaActivity;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 *
 * 砍价活动参与记录 数据处理层
 *
 * @author qiuqiu
 * @date 2021/7/1
 */
public interface KanJiaActivityMapper extends BaseMapper<KanjiaActivity> {

    @Select("SELECT * FROM li_kanjia_activity where kanjia_activity_goods_id in (select kag.id from li_kanjia_activity_goods kag where kag.id = kanjia_activity_goods_id and kag.start_time is not null and kag.end_time is not null) and ${ew.sqlSegment}")
    Page<KanjiaActivity> getMineKanJiaActivity(Page<KanjiaActivity> page, @Param(Constants.WRAPPER) Wrapper<KanjiaActivity> queryWrapper);

}